/**
 * ktvme.com Inc.
 * Copyright (c) 2004-2014 All Rights Reserved.
 */
package com.zhangzhi.common.sql;

import org.apache.ibatis.session.SqlSessionFactory;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.FileSystemXmlApplicationContext;

/**
 * 
 * 
 * @author yangxiaobin@star-net.cn
 * @version Id: MyBatisUtil.java, v 0.5 2014年11月13日 yangxiaobin
 */
public class MyBatisUtil {
	private final static SqlSessionFactory sqlSessionFactory;

	static {
		ApplicationContext ac = new FileSystemXmlApplicationContext(
				"classpath:spring/spring-datasource.xml");
		sqlSessionFactory = (SqlSessionFactory) ac.getBean("sqlSessionFactory");
	}

	public static SqlSessionFactory getSqlSessionFactory() {
		return sqlSessionFactory;
	}
}
